package jp.co.sn.mml.pojo.tmpattern;

import jp.co.sn.mml.pojo.tsprogram.Tsprogram;

public class TmpatternId implements java.io.Serializable { 

	//プログラムID
	private Tsprogram programId;
	//パターンコード
	private String ptCd;

	/** default constructor */
	public TmpatternId(){

	}

	/** full constructor */
	public TmpatternId(Tsprogram programId,String ptCd){
		this.programId = programId;
		this.ptCd = ptCd;
	}

	//Property accessors
	public Tsprogram getProgramId(){
		return this.programId;
	}

	public void setProgramId(Tsprogram programId){
		this.programId=programId;
	}

	public String getPtCd(){
		return this.ptCd;
	}

	public void setPtCd(String ptCd){
		this.ptCd=ptCd;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof TmpatternId))
			return false;

		TmpatternId castOther = (TmpatternId) other;

		return ((this.getProgramId() ==  castOther.getProgramId())
				||(this.getProgramId()!=null && castOther.getProgramId() !=null 
					&& castOther.getProgramId() !=null 
					&& this.getProgramId().equals(castOther.getProgramId())))
			&& ((this.getPtCd() ==  castOther.getPtCd())
				||(this.getPtCd()!=null && castOther.getPtCd() !=null 
					&& castOther.getPtCd() !=null 
					&& this.getPtCd().equals(castOther.getPtCd())))
;	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getProgramId() == null ? 0 : this.getProgramId().hashCode());
		result = 37 * result
				+ (getPtCd() == null ? 0 : this.getPtCd().hashCode());
		return result;
	}

}